<template>
  <layout>
    <template slot="title" v-if="!isPublish">
      <span>
        <b>种粮大户补贴申报信息列表</b>
      </span>
      <template>
        <a-button
          type="default"
          style="margin-left: 20px; margin-right: 20px"
          auth="large-member.add"
          @click="handlerTableAdd()"
          >添加大户档案</a-button
        >
        <a-button
          key="submit"
          type="default"
          style="margin-right: 20px"
          @click="handlerPreview({ big_mb_id: '' })"
        >
          打印空白申请表
        </a-button>

        <a-radio-group v-model="renderFields">
          <a-radio-button :value="0" icon="bars"> 显示全部字段 </a-radio-button>
          <a-radio-button :value="1" icon="bars">
            仅显示基础信息
          </a-radio-button>
          <a-radio-button :value="2"> 仅显示耕地信息 </a-radio-button>
        </a-radio-group>
        <!-- <a-button-group>
          <a-button
            type="primary"
            icon="cloud-upload"
            @click="$refs.GrainImport.handlerUploadExecl()"
          >导入原单机版申报信息</a-button>
          <a-button
            type="default"
            icon="download"
            style="margin-right: 20px;"
            @click="handlerDownload($downloadLargeMemberTemplate)"
          >
            下载申报信息模板
          </a-button>
        </a-button-group>

        <a-button
          type="dashed"
          icon="question-circle"
          @click="events.trigger('show-helper')"
        >
          帮助
        </a-button> -->
      </template>
    </template>

    <!-- 顶部操作 -->
    <section slot="search">
      <custom-form
        ref="search-form"
        class="search-form"
        :class="{ 'one-line': isOpen }"
        v-model="tableSearch"
        layout="inline"
        mode="search"
        :FormList="searchColumns"
      >
      </custom-form>

      <section style="margin-top: 4px">
        <a-button
          class="action-button"
          type="default"
          :icon="isOpen ? 'down' : 'up'"
          @click="isOpen = !isOpen"
          >{{ isOpen ? '展开' : '收缩' }}搜索条件字段</a-button
        >
        <a-button
          class="action-button"
          type="primary"
          icon="search"
          @click="search()"
          >搜索</a-button
        >

        <a-button-group>
          <a-button type="default" @click="handlerTableExportExecl()"
            >按搜索条件导出电子表（模板）</a-button
          >

          <a-button
            class="action-button"
            @click="$refs.LargeGrainImport.handlerUploadExecl()"
            >导入电子表更新数据</a-button
          >
        </a-button-group>

        <section class="opreate">
          <!-- <a-popconfirm
            :title="batchIsUsed ? `是否全部取消当前行政区大户的补贴标记？` : '是否全部标记将当前行政区大户为“参与补贴”？'"
            ok-text="确认"
            cancel-text="取消"
            @confirm="batchIsUsed = !batchIsUsed"
          >
            <a-button :loading="(batchIsUsedLoading || tableLoading)">
              <span>批量修改当前行政区下补贴状态</span>
            </a-button>
          </a-popconfirm> -->
          <a-button :loading="tableLoading" @click="handlerBatchChangeStatus">
            <span>批量修改当前行政区下补贴状态</span>
          </a-button>

          <a-button
            :loading="batchDelLoading"
            auth="large-member.batch-delete"
            @click="handlerBatchDelLarge"
            >批量删除未加入补贴大户</a-button
          >

          <a-button
            type="default"
            :auth="{
              keys: ['member.publish-add', !(currentAreaId.length < 6 )],
              relate: 'and'
            }"
            @click="handlerPublic(false)"
          >起草公示信息</a-button>

          <a-button
            type="default"
            auth="member.export-fund-release"
            @click="handlerExportExecl(true)"
            >导出资金分户明细表</a-button
          >
        </section>
      </section>
    </section>

    <!-- <section class="message-tips ant-alert ant-alert-info ant-alert-no-icon">
      
      <section class="opreate">
        <a-popconfirm
          :title="batchIsUsed ? `是否全部取消当前行政区大户的补贴标记？` : '是否全部标记将当前行政区大户为“参与补贴”？'"
          ok-text="确认"
          cancel-text="取消"
          @confirm="batchIsUsed = !batchIsUsed"
        >
          <a-spin size="small" :spinning="(batchIsUsedLoading || tableLoading)">
            <a-button>
              <a-checkbox v-model="batchIsUsed"></a-checkbox>
              <span style="margin-left: 10px;">批量修改当前行政区下补贴状态</span>
            </a-button>
          </a-spin>
        </a-popconfirm>
      </section>
      {{ `下列共${total}户（${isUsed}）` }}
    </section> -->

    <!-- 产品列表 -->
    <a-table
      :dataSource="tableData"
      :columns="tableColumns"
      :rowKey="(record) => record.big_mb_id"
      :pagination="false"
      :loading="tableLoading"
      :customRow="customRow"
      :row-selection="rowSelection"
      class="table-total large-grain-detail"
      :scroll="{
        x: 'max-content',
        y: tableClientHeight,
      }"
      bordered
      @change="handleTableChange"
    >
      <!-- 自定义标题 -->
      <template slot="pay_size_title"> 补贴面积<br />（亩） </template>
      <template slot="pay_price_title"> 补贴标准<br />（亩/元） </template>

      <template slot="apl_bh" slot-scope="row">
        {{ row.apl_bh }}
      </template>

      <template slot="s_a_nam_all" slot-scope="row">
        <a-tooltip :title="row.s_a_nam_all">
          <a>
            {{
              row.s_a_nam_all && row.s_a_nam_all.length
                ? '..' + row.s_a_nam_all.slice(-8)
                : ''
            }}
          </a>
        </a-tooltip>
      </template>

      <template slot="big_mb_ck1" slot-scope="row">
        {{ getLabel(row.big_mb_ck1, [], 'big_mb_ck1') }}
      </template>
      <template slot="big_mb_ck2" slot-scope="row">
        {{ getLabel(row.big_mb_ck2, [], 'big_mb_ck2') }}
      </template>
      <template slot="big_mb_ck3" slot-scope="row">
        {{ getLabel(row.big_mb_ck3, [], 'big_mb_ck3') }}
      </template>

      <template slot="big_mb_type" slot-scope="row">
        {{ getLabel(row.big_mb_type, [], 'big_mb_type') }}
      </template>
      <template slot="big_mb_bank_code" slot-scope="row">
        {{ getLabel(row.big_mb_bank_code, [], 'big_mb_bank_code') }}
      </template>
      <template slot="pay_unit" slot-scope="row">
        {{ getLabel(row.pay_unit, [], 'pay_unit') }}
      </template>
      <template slot="field" slot-scope="row">
        {{ row.field || 0 }}
      </template>
      <template slot="field1" slot-scope="row, record, index">
        <span v-if="index === 0">{{ row.field1 || 0 }}</span>
        <a-button
          v-else
          type="link"
          :auth="['large-member.field-list', 'publish.member-list']"
          showDefaultLabel
          @click.stop="handlerManageFarmLand(row, 1)"
          >{{ row.field1 || 0 }}</a-button
        >
      </template>
      <template slot="field2" slot-scope="row, record, index">
        <span v-if="index === 0">{{ row.field2 || 0 }}</span>
        <a-button
          v-else
          type="link"
          :auth="['large-member.field-list', 'publish.member-list']"
          showDefaultLabel
          @click.stop="handlerManageFarmLand(row, 2)"
          >{{ row.field2 || 0 }}</a-button
        >
      </template>
      <template slot="field3" slot-scope="row, record, index">
        <span v-if="index === 0">{{ row.field3 || 0 }}</span>
        <a-button
          v-else
          type="link"
          :auth="['large-member.field-list', 'publish.member-list']"
          showDefaultLabel
          @click.stop="handlerManageFarmLand(row, 3)"
          >{{ row.field3 || 0 }}</a-button
        >
      </template>
      <template slot="plant" slot-scope="row, record, index">
        <span v-if="index === 0">{{ row.plant || 0 }}</span>
        <a-button
          v-else
          type="link"
          :auth="['large-member.edit', 'publish.member-list']"
          showDefaultLabel
          @click.stop="handleTableEdit(row, 'plant')"
          >{{ row.plant || 0 }}</a-button
        >
      </template>

      <template slot="material" slot-scope="row, record, index">
        <span v-if="index === 0">{{ row.material || 0 }}</span>
        <a-button
          v-else
          type="link"
          :auth="['large-member.edit', 'publish.member-list']"
          showDefaultLabel
          @click.stop="handleTableEdit(row, 'material')"
          >{{ row.material || 0 }}</a-button
        >
      </template>
      <template slot="machine" slot-scope="row, record, index">
        <span v-if="index === 0">{{ row.machine || 0 }}</span>
        <a-button
          v-else
          type="link"
          :auth="['large-member.edit', 'publish.member-list']"
          showDefaultLabel
          @click.stop="handleTableEdit(row, 'machine')"
          >{{ row.machine || 0 }}</a-button
        >
      </template>

      <template slot="upload_status" slot-scope="row">
        <span
          v-if="row.upload_status !== '未上传'"
          @click.stop="handlerUploadImages(row)"
        >
          {{ row.upload_status }}
        </span>
        <a-button
          v-else
          class="action-button"
          type="link"
          size="small"
          :auth="['large-member.image-upload']"
          @click.stop="handlerUploadImages(row)"
          >{{ row.upload_status !== '未上传' ? '' : '' }}上传图片</a-button
        >
      </template>
      <!-- 按钮区 -->

      <template slot="action" slot-scope="row, record, index">
        <template v-if="index === 0">
          <a-button
            v-if="currentAreaId.length >= 6 && currentAreaId.length <= 12"
            class="action-button"
            type="link"
            size="small"
            auth="large-member.batch-verify"
            @click.stop="$refs.BatchVerify.show(currentAreaId)"
            >批量填写审核审批意见</a-button
          >
        </template>
        <template v-else>
          <a-button
            class="action-button"
            type="link"
            size="small"
            auth="large-member.edit"
            @click.stop="handleTableEdit(row, 'edit')"
            >编辑</a-button
          >
          <a-button
            class="action-button"
            type="link"
            size="small"
            auth="large-member.auth"
            @click.stop="handleTableEdit(row, 'review')"
            >审核</a-button
          >
          <a-dropdown>
            <a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
              更多 <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm
                  title="您确认要删除该条数据?"
                  ok-text="确认"
                  cancel-text="取消"
                  @confirm="tableDel(row)"
                >
                <a-button
                  type="link"
                  auth="large-member.delete"
                  size="small"
                  @click.stop
                  >删除</a-button
                >
                </a-popconfirm>
                
              </a-menu-item>
              <a-menu-item>
                <a-button
                  type="link"
                  size="small"
                  auth="large-member.preview"
                  @click.stop="handlerPreview(row)"
                  >预览</a-button
                >
              </a-menu-item>

              <a-menu-item>
                <a-button
                  type="link"
                  size="small"
                  :auth="['large-member.field-list']"
                  @click.stop="handlerManageFarmLand(row, '')"
                  >耕地信息</a-button
                >
              </a-menu-item>
              <a-menu-item>
                <a-button
                  type="link"
                  size="small"
                  :auth="['large-member.plant']"
                  @click.stop="handleTableEdit(row, 'plant')"
                  >种粮信息</a-button
                >
              </a-menu-item>
            </a-menu>
          </a-dropdown>
          <!-- <a-popconfirm
            title="您确认要导出导出该大户分户信息?"
            ok-text="确认"
            cancel-text="取消"
            @confirm="handlerExportField(row)"
          >
            <a-button
              class="action-button"
              type="link"
              size="small"
              :auth="['large-member.export-field']"
              @click.stop
            >导出分户信息</a-button>
          </a-popconfirm> -->
        </template>
      </template>
    </a-table>

    <!-- 产品列表分页器 -->
    <a-pagination
      slot="paging"
      :pageSizeOptions="pageSizes"
      :total="total"
      showSizeChanger
      :show-total="showTotal"
      :pageSize="pageSize"
      v-model="currentPage"
      @showSizeChange="changePageSize"
      @change="changePage"
    >
    </a-pagination>

    <!-- 编辑产品数据 -->
    <a-modal
      :visible="visible"
      :title="visibleTitle"
      centered
      :maskClosable="false"
      :width="customMode === 'edit' ? 1100 : customMode === 'add' ? 560 : 480"
      v-bind="isPublish ? { footer: null } : {}"
      @cancel="visible = false"
      @ok="handleSubmit"
    >
      <custom-form
        ref="custom-form"
        class="custom-form"
        :class="{ 'review-form': customMode === 'review' }"
        v-model="currentRow"
        :FormList="formColumns"
        :mode="customMode"
        v-bind="formItemLayout"
        layout="horizontal"
      >
        <template slot="big_mb_ck1" slot-scope="{ params, column }">
          <a-input v-model="params.big_mb_ck1" v-bind="column.form">
            <!-- <a-icon slot="addonAfter" type="setting" /> -->
            <span
              slot="addonAfter"
              style="cursor: pointer"
              @click="handlerCheck(params)"
              >核查计算</span
            >
          </a-input>
        </template>
      </custom-form>
    </a-modal>

    <!-- 管理耕地信息 -->
    <a-drawer
      :title="currentRow.big_mb_nam + '-耕地管理'"
      placement="right"
      :closable="false"
      width="80%"
      :visible="drawerVisible"
      @close="drawerVisible = false"
    >
      <Farmland
        :currentField="currentRow"
        :currentFieldType="currentFieldType"
        :isReadOnly="Boolean(currentPublishId)"
        :currentPublishId="currentPublishId"
      />
    </a-drawer>

    <a-modal
      :visible="subsidyVisible"
      :title="
        `${currentRow.big_mb_nam ? currentRow.big_mb_nam + '-' : ''}` +
        '种粮大户补贴申报表'
      "
      centered
      :width="840"
      @cancel="subsidyVisible = false"
    >
      <Preview :currentRow="currentRow" />
      <template slot="footer">
        <template>
          <a-button
            class="action-button"
            showDefaultLabel
            :auth="{
              keys: ['large-member.image-upload'],
            }"
            @click.stop="handlerUploadImages(currentRow)"
            >{{ currentRow.upload_status }}纸质申报表，{{
              currentRow.upload_status === '已上传'
                ? '点我重新上传'
                : '点我上传'
            }}</a-button
          >
        </template>
        <a-popconfirm
          title="您确认要删除申报数据?"
          ok-text="确认"
          cancel-text="取消"
          v-if="currentRow.big_mb_id"
          @confirm="handlerDeleteApply()"
        >
          <a-button key="del"> 删除申报数据 </a-button>
        </a-popconfirm>
        <a-button key="back" @click="subsidyVisible = false"> 取消 </a-button>
        <a-button
          key="submit"
          type="primary"
          v-print="{ id: '#subsidy-table', popTitle: settingModule.systemName }"
        >
          打印
        </a-button>
      </template>
    </a-modal>

    <LargeGrainImport ref="LargeGrainImport" />

    <BatchVerify ref="BatchVerify" @batch-verify-success="getData" />
  </layout>
</template>

<script lang="ts">
import { Mixins, Component, Watch, Vue, Prop } from 'vue-property-decorator'
import EventsMixin from '@/mixin/events'
import { TableMixin, AuthMixin } from '@/mixin'
import { RosterMixins } from '../farmers/mixin'

import { TableLayout } from '@/layouts'
import CustomForm from '@/components/src/Form'
import {
  largeMemberServices,
  ILargeMemberDetail,
  ILargeField,
  ILargeMember,
} from '@/common/services/largeMember'
import { publishServices } from '@/common/services/publish'
import { commonServices } from '@/common/services/common'
import { BatchChangeUsedStatusMixin } from '../farmers/BatchChangeUsedStatusMixin'
import {
  memberRole,
  LargeMemberType,
  reviewDict,
  PayUnitType,
  PayUnitTypeEnum,
} from '@/common/enum'
import Farmland from './Farmland.vue'
import Preview from './Preview.vue'
import { userModule } from '@/store/modules/user'
import { settingModule } from '@/store/modules/setting'
import LargeGrainImport from '../large-grain/LargeImport.vue'
import UploadImage from '../large-grain/UploadImage.vue'
import { PublishMixin } from '../farmers/PublishMixin'
import BatchVerify from './BatchVerify.vue'

import { merge } from 'lodash-es'
import { IGrain } from '@/common/services/famer'

@Component({
  components: {
    Layout: TableLayout,
    CustomForm,
    Farmland,
    Preview,
    LargeGrainImport,
    BatchVerify,
  },
})
export default class AdminList extends Mixins(
  EventsMixin,
  TableMixin,
  AuthMixin,
  PublishMixin,
  RosterMixins,
  BatchChangeUsedStatusMixin
) {
  @Prop({
    type: String,
  })
  public currentPublishId!: string

  public isOpen = true

  get isPublish() {
    return Boolean(this.currentPublishId)
  }

  get currentUserArea() {
    return userModule.currentUserArea
  }

  get settingModule() {
    return settingModule
  }

  public commonParams = {
    s_a_id: '',
    pub_id: this.currentPublishId,
  }

  // 产品列表搜索条件
  public tableSearch = {
    show_area: '0',
    is_pub: '',
    switch: '2',
  }

  public requireExportFields = ['big_mb_id', 'big_mb_nam', 's_a_id']

  // 自定义mode
  public customMode = 'add'
  public hasTotalRow = true

  public formItemLayout = {
    labelCol: { span: 6 },
    wrapperCol: { span: 18 },
  }

  // 当前列表渲染内容
  public renderFields: number = 0 // 0-全部 1-基础信息 2-耕地
  // 审核功能字段
  get reviewFields() {
    const len = this.currentUserArea.s_a_id.length
    const reviews = [
      {
        title: '区县核定',
        key: 'big_mb_ck',
        children: [
          {
            title: '核定补贴面积(亩)',
            width: 130,
            dataIndex: 'big_mb_ck',
            key: 'big_mb_ck',
            align: 'right',
            form: {
              type: 'a-input',
              placeholder: '请输入区县核定补贴面积',
              renderMode: ['review'],
              len: 6,
            },
          },
          {
            title: '负责人',
            dataIndex: 'big_mb_ck_u',
            key: 'big_mb_ck_u',
            width: 80,
            form: {
              type: 'a-input',
              placeholder: '请输入区县负责人姓名',
              renderMode: ['review'],
              len: 6,
            },
          },
          {
            title: '核定日期',
            dataIndex: 'big_mb_time',
            key: 'big_mb_time',
            width: 90,
            form: {
              type: 'a-date-picker',
              placeholder: '请选择区县核定日期',
              // showTime: { format: 'HH:mm' },
              format: 'YYYY-MM-DD',
              valueFormat: 'YYYY-MM-DD',
              renderMode: ['review'],
              len: 6,
            },
          },
        ],
      },

      {
        title: '乡镇核查',
        key: 'big_mb_ck1',
        children: [
          {
            title: '核查面积（亩）',
            // scopedSlots: { customRender: 'big_mb_ck1' },
            dataIndex: 'big_mb_ck1',
            width: 120,
            key: 'big_mb_ck1',
            align: 'right',
            form: {
              type: 'a-input',
              placeholder: '请输入乡镇核查面积',
              renderMode: ['review'],
              len: 9,
              slot: 'big_mb_ck1',
              // dict: reviewDict
            },
          },
          {
            title: '负责人',
            dataIndex: 'big_mb_ck_u1',
            key: 'big_mb_ck_u1',
            width: 80,
            form: {
              type: 'a-input',
              placeholder: '请输入乡负责人姓名',
              renderMode: ['review'],
              len: 9,
            },
          },
          {
            title: '审核日期',
            dataIndex: 'big_mb_time1',
            key: 'big_mb_time1',
            width: 90,
            form: {
              type: 'a-date-picker',
              placeholder: '请选择乡镇审核日期',
              // showTime: { format: 'HH:mm' },
              format: 'YYYY-MM-DD',
              valueFormat: 'YYYY-MM-DD',
              renderMode: ['review'],
              len: 9,
            },
          },
        ],
      },

      {
        title: '驻村干部审核',
        key: 'big_mb_ck3',
        children: [
          {
            title: '审核意见',
            scopedSlots: { customRender: 'big_mb_ck3' },
            key: 'big_mb_ck3',
            width: 80,
            form: {
              type: 'a-radio-group',
              placeholder: '请选择驻村干部审核意见',
              renderMode: ['review'],
              dict: reviewDict,
              len: 12,
            },
          },
          {
            title: '审核人',
            dataIndex: 'big_mb_ck_u3',
            key: 'big_mb_ck_u3',
            width: 80,
            form: {
              type: 'a-input',
              placeholder: '请输入驻村干部审核人姓名',
              renderMode: ['review'],
              len: 12,
            },
          },
          {
            title: '审核日期',
            dataIndex: 'big_mb_time3',
            key: 'big_mb_time3',
            width: 90,
            form: {
              type: 'a-date-picker',
              placeholder: '请选择乡镇审核日期',
              // showTime: { format: 'HH:mm' },
              format: 'YYYY-MM-DD',
              valueFormat: 'YYYY-MM-DD',
              renderMode: ['review'],
              len: 12,
            },
          },
        ],
      },

      {
        title: '村委审核',
        key: 'big_mb_ck2',
        children: [
          {
            title: '审核意见',
            scopedSlots: { customRender: 'big_mb_ck2' },
            key: 'big_mb_ck2',
            width: 80,
            form: {
              type: 'a-radio-group',
              placeholder: '请选择村委审核意见',
              renderMode: ['review'],
              dict: reviewDict,
              len: 12,
            },
          },
          {
            title: '审核人',
            dataIndex: 'big_mb_ck_u2',
            key: 'big_mb_ck_u2',
            width: 80,
            form: {
              type: 'a-input',
              placeholder: '请输入村委审核人姓名',
              renderMode: ['review'],
              len: 12,
            },
          },
          {
            title: '审核日期',
            dataIndex: 'big_mb_time2',
            key: 'big_mb_time2',
            width: 90,
            form: {
              type: 'a-date-picker',
              placeholder: '请选择乡镇审核日期',
              // showTime: { format: 'HH:mm' },
              format: 'YYYY-MM-DD',
              valueFormat: 'YYYY-MM-DD',
              renderMode: ['review'],
              len: 12,
            },
          },
        ],
      },

      {
        title: '申报日期',
        dataIndex: 'apl_time',
        key: 'apl_time',
        width: 90,
        form: {
          type: 'a-date-picker',
          placeholder: '请选择申请日期',
          format: 'YYYY-MM-DD',
          valueFormat: 'YYYY-MM-DD',
          renderMode: ['review'],
        },
      },
    ]
    return reviews.map((column) => {
      if (!column.children) return column
      // @ts-ignore
      column.children = column.children.map((item) => {
        const disabled = (item?.form?.len || 0) < len
        return merge(item, {
          form: {
            disabled: disabled,
          },
        })
      })
      return column
    })
  }

  public commonColumns: ITable.IColumn[] = [
    {
      title: '公示编号',
      dataIndex: 'pub_id',
      key: 'pub_id',
      width: 120,
      form: {
        type: 'a-input',
        placeholder: '请输入公示编号',
        isShowList: true,
        isShowQuery: true,
        isShowFrom: false,
      },
    },
    {
      title: '申报编号',
      // dataIndex: 'apl_bh',
      key: 'apl_bh',
      width: 130,
      scopedSlots: { customRender: 'apl_bh' },
      form: {
        type: 'a-input',
        placeholder: '编号自动生成',
        isShowFrom: false,
      },
    },
    {
      title: '大户编号',
      dataIndex: 'big_mb_id',
      key: 'big_mb_id',
      width: 120,
      form: {
        type: 'a-input',
        placeholder: '编号自动生成',
        disabled: true,
        renderMode: ['edit'],
      },
    },
    {
      title: '受理行政区编码',
      // dataIndex: 's_a_nam_all',
      key: 's_a_id',
      dataIndex: 's_a_id',
      width: 150,
    },
    {
      title: '受理行政区',
      // dataIndex: 's_a_nam_all',
      key: 's_a_nam_all',
      align: 'right',
      scopedSlots: { customRender: 's_a_nam_all' },
      width: 150,
      form: {
        type: 'a-input',
        placeholder: '编号自动生成',
        isShowFrom: false,
      },
    },
    {
      title: '大户名称',
      dataIndex: 'big_mb_nam',
      key: 'big_mb_nam',
      width: 160,
      form: {
        type: 'a-input',
        placeholder: '请输入大户名称',
        isShowQuery: true,
        renderMode: ['search', 'edit', 'add'],
      },
    },
  ]

  // 大户基础信息
  public LargeMembersColumns: ITable.IColumn[] = [
    // 搜索字段
    {
      title: '大户类型',
      key: 'big_mb_type',
      width: 80,
      scopedSlots: { customRender: 'big_mb_type' },
      form: {
        type: 'a-radio-group',
        placeholder: '请选择大户类型',
        dict: LargeMemberType,
        isShowQuery: true,
        validate: '*',
        renderMode: ['search', 'edit', 'add'],
        on: {
          // change: (...e) => {
          //   console.log(e)
          // }
        },
      },
    },

    {
      title: '法定编码',
      dataIndex: 'big_mb_law_id',
      width: 180,
      key: 'big_mb_law_id',
      form: {
        type: 'a-input',
        placeholder: '请输入农户编码或企业社会信用代码',
        renderMode: ['edit', 'add'],
      },
    },
    // {
    //   title: '种粮地行政区',
    //   dataIndex: 's_a_nam_all',
    //   key: 's_a_nam_all',
    //   width: 200,
    //   ellipsis: true,
    //   form: {
    //     type: 'a-input',
    //     placeholder: '请输入种粮地点',
    //     renderMode: ['edit']
    //   }
    // },
    {
      title: '种粮地点',
      dataIndex: 'big_mb_addr',
      key: 'big_mb_addr',
      width: 150,
      form: {
        type: 'a-input',
        placeholder: '请输入种粮地点',
        renderMode: ['edit', 'add'],
      },
    },

    {
      title: '负责人',
      dataIndex: 'big_mb_user',
      width: 80,
      key: 'big_mb_user',
      form: {
        type: 'a-input',
        placeholder: '请输入负责人姓名',
        renderMode: ['edit', 'add'],
      },
    },
    {
      title: '负责人身份证',
      dataIndex: 'big_mb_sfz',
      width: 160,
      key: 'big_mb_sfz',
      form: {
        type: 'a-input',
        placeholder: '请输入负责人身份证',
        renderMode: ['edit', 'add'],
      },
    },
    {
      title: '联系电话',
      dataIndex: 'big_mb_tel',
      key: 'big_mb_tel',
      width: 110,
      form: {
        type: 'a-input',
        placeholder: '请输入联系电话',
        renderMode: ['edit', 'add'],
      },
    },
    {
      title: '银行账号',
      dataIndex: 'big_mb_bank_id',
      key: 'big_mb_bank_id',
      width: 150,
      form: {
        type: 'a-input',
        placeholder: '请输入银行账号',
        renderMode: ['edit', 'add'],
        isShowQuery: true,
      },
    },
    {
      title: '开户名',
      dataIndex: 'big_mb_bank_user',
      key: 'big_mb_bank_user',
      width: 150,
      form: {
        type: 'a-input',
        placeholder: '请输入银行户名',
        renderMode: ['edit', 'add'],
      },
    },
    {
      title: '开户行',
      key: 'big_mb_bank_code',
      width: 150,
      scopedSlots: { customRender: 'big_mb_bank_code' },
      form: {
        type: 'a-auto-complete',
        placeholder: '请选择/输入开户银行',
        showSearch: true,
        dataSource: [],
        renderMode: ['edit', 'add'],
      },
    },
  ]

  // 耕地信息
  public fieldColumns: ITable.IColumn[] = [
    {
      title: '耕地面积（亩）',
      width: 300,
      key: 'field',
      children: [
        {
          title: '合计',
          scopedSlots: { customRender: 'field' },
          key: 'field',
          width: 110,
          form: {
            type: 'a-input',
            placeholder: '请输入耕地总面积',
            renderMode: ['farmland'],
          },
        },
        {
          title: '承包地',
          scopedSlots: { customRender: 'field1' },
          key: 'field1',
          sorter: true,
          sortDirections: ['ascend', 'descend'],
          width: 110,
          form: {
            type: 'a-input',
            placeholder: '请输入耕地总面积',
            renderMode: ['farmland'],
            isShowForm: false,
            isShowQuery: true,
            querySection: true,
          },
        },
        {
          title: '增加面积',
          scopedSlots: { customRender: 'field2' },
          key: 'field2',
          sorter: true,
          sortDirections: ['ascend', 'descend'],
          width: 110,
          form: {
            type: 'a-input',
            placeholder: '请输入耕地总面积',
            renderMode: ['farmland'],
            isShowQuery: true,
            isShowForm: false,
            querySection: true,
          },
        },
        {
          title: '减少面积',
          scopedSlots: { customRender: 'field3' },
          key: 'field3',
          sorter: true,
          sortDirections: ['ascend', 'descend'],
          width: 110,
          form: {
            type: 'a-input',
            placeholder: '请输入耕地总面积',
            renderMode: ['farmland'],
            isShowQuery: true,
            isShowForm: false,
            querySection: true,
          },
        },
      ],
    },

    // 表单专用
    {
      title: '承包地(亩)',
      scopedSlots: { customRender: 'field1' },
      key: 'field1',
      sorter: true,
      sortDirections: ['ascend', 'descend'],
      width: 110,
      form: {
        type: 'a-input',
        placeholder: '请输入耕地总面积',
        renderMode: ['farmland', 'edit'],
        isShowForm: true,
        col: 1,
        isShowList: false,
        isShowQuery: false,
        querySection: true,
      },
    },
    {
      title: '增加面积(亩)',
      scopedSlots: { customRender: 'field2' },
      key: 'field2',
      sorter: true,
      sortDirections: ['ascend', 'descend'],
      width: 110,
      form: {
        type: 'a-input',
        placeholder: '请输入耕地总面积',
        renderMode: ['farmland', 'edit'],
        isShowList: false,
        col: 1,
        isShowQuery: false,
        querySection: true,
      },
    },
    {
      title: '减少面积(亩)',
      scopedSlots: { customRender: 'field3' },
      key: 'field3',
      sorter: true,
      sortDirections: ['ascend', 'descend'],
      width: 110,
      form: {
        type: 'a-input',
        placeholder: '请输入耕地总面积',
        renderMode: ['farmland', 'edit'],
        isShowList: false,
        col: 1,
        isShowQuery: false,
        querySection: true,
      },
    },

    {
      title: '粮食种植面积(亩)',
      key: 'plant',
      width: 120,
      sorter: true,
      sortDirections: ['ascend', 'descend'],
      align: 'center',
      scopedSlots: { customRender: 'plant' },
      form: {
        type: 'a-input',
        isShowQuery: true,
        renderMode: ['edit'],
        col: 1,
        querySection: true,
        isShowFrom: true,
      },
    },
    {
      title: '购买农资花费(元)',
      key: 'material',
      width: 120,
      align: 'center',
      scopedSlots: { customRender: 'material' },
      form: {
        type: 'a-input',
        renderMode: ['edit'],
        col: 1,
        isShowFrom: true,
      },
    },
    {
      title: '农机数量(台)',
      key: 'machine',
      width: 80,
      align: 'center',
      scopedSlots: { customRender: 'machine' },
      form: {
        type: 'a-input',
        renderMode: ['edit'],
        col: 1,
        isShowFrom: true,
      },
    },
  ]

  // 金额相关字段
  public moneyFields: ITable.IColumn[] = [
    {
      title: '补贴参照',
      scopedSlots: { customRender: 'pay_unit' },
      key: 'pay_unit',
      align: 'center',
      width: 110,
      form: {
        type: 'a-select',
        placeholder: '请选择补贴参照',
        isShowFrom: false,
        dict: PayUnitType,
      },
    },
    {
      // title: '补贴面积',
      titleAlias: '补贴面积（亩）',
      slots: { title: 'pay_size_title' },
      dataIndex: 'pay_size_total',
      key: 'pay_size_total',
      align: 'right',
      width: 110,
    },

    {
      title: '补贴面积（亩）',
      dataIndex: 'pay_size_total',
      key: 'pay_size_total',
      align: 'right',
      width: 110,
      form: {
        type: 'a-input',
        placeholder: '请输入耕地总面积',
        isShowQuery: true,
        isShowList: false,
        isShowFrom: false,
        querySection: true,
      },
    },

    // {
    //   title: '核定面积',
    //   dataIndex: 'big_mb_ck',
    //   key: 'big_mb_ck',
    //   align: 'right',
    //   width: 110,
    // },
    {
      // title: '补贴标准（亩/元）',
      titleAlias: '补贴标准（亩/元）',
      slots: { title: 'pay_price_title' },
      // scopedSlots: { title: 'pay_price' },
      dataIndex: 'pay_price',
      key: 'pay_price',
      align: 'right',
      width: 80,
    },
    {
      title: '补贴总金额（元）',
      dataIndex: 'pay_price_total',
      key: 'pay_price_total',
      align: 'right',
      width: 120,
    },
  ]

  // 产品列表表格信息
  get formatColumns() {
    return [
      {
        title: '查询范围',
        key: 'show_area',
        dataIndex: 'show_area',
        width: 80,
        form: {
          type: 'a-radio-group',
          placeholder: '请选择大户类型',
          dict: [
            {
              label: '本区域申报的',
              value: '0',
            },
            {
              label: '本区域种植的',
              value: '1',
            },
          ],
          isShowQuery: true,
          isShowList: false,
          isShowAll: false,
          renderMode: ['search'],
        },
      },

      {
        title: '补贴状态',
        dataIndex: 'is_used',
        key: 'is_used',
        width: 100,
        form: {
          type: 'a-radio-group',
          placeholder: '请选择补贴状态',
          isShowList: false,
          renderMode: ['search'],
          isShowFrom: false,
          isShowQuery: true,
          isExport: true,
          dict: [
            {
              label: '已加入',
              value: '1',
            },
            {
              label: '未加入',
              value: '2',
            },
          ],
        },
      },

      {
        title: '是否加入公示',
        dataIndex: 'is_pub',
        key: 'is_pub',
        width: 140,
        form: {
          type: 'a-radio-group',
          placeholder: '请选择补贴状态',
          isShowList: false,
          isShowQuery: true,
          isShowFrom: false,
          dict: [
            {
              label: '已加入',
              value: '1',
            },
            {
              label: '未加入',
              value: '2',
            },
          ],
        },
      },

      ...this.commonColumns,

      ...([0, 1].includes(this.renderFields) ? this.LargeMembersColumns : []),
      ...([0, 2].includes(this.renderFields) ? this.fieldColumns : []),
      ...this.moneyFields,

      {
        title: '选择查重/查错条件',
        dataIndex: 'member_filter',
        key: 'member_filter',
        width: 260,
        form: {
          type: 'a-checkbox-group',
          placeholder: '请选择查重/查错条件',
          dict: [
            {
              label: '姓名为空',
              value: 'member_nam_empty',
            },
            {
              label: '身份证为空',
              value: 'member_sfz_empty',
            },
            {
              label: '联系电话为空',
              value: 'member_tel_empty',
            },
            {
              label: '身份证查重',
              value: 'member_sfz_repeat',
            },
            {
              label: '银行卡号查重',
              value: 'member_bank_num_repeat',
            },
            {
              label: '姓名查重',
              value: 'member_nam_repeat',
            },
          ],
          mode: 'multiple',
          renderMode: ['filter'],
          isShowAll: false,
          isShowFrom: false,
          isShowList: false,
          isShowQuery: true,
        },
      },

      // 审核字段
      ...([0, 1, 2].includes(this.renderFields) ? this.reviewFields : []),

      {
        title: '数据异常说明',
        key: 'error_msg',
        dataIndex: 'error_msg',
        width: 210,
      },
      {
        title: '上传申报表状态',
        key: 'upload_status',
        scopedSlots: { customRender: 'upload_status' },
        width: 210,
      },
      {
        title: '操作',
        key: 'action',
        width: 200,
        fixed: 'right',
        scopedSlots: { customRender: 'action' },
      },
    ]
  }

  // @ts-ignore
  public columns: ITable.IColumn[] = this.formatColumns

  public tableApi = {
    list: this.currentPublishId
      ? publishServices.getPublishUsers
      : largeMemberServices.getLargeMemberDetail,
    add: largeMemberServices.updateLargeMember,
    edit: largeMemberServices.updateLargeMember,
    del: largeMemberServices.deleteLargeMember,
    exportExecl: largeMemberServices.exportExecl,
    // imageUpload: 'uploadStoreImage',
    // imageRemove: 'delStoreImage'
  }

  @Watch('renderFields')
  public handlerChangeRenderFields() {
    // @ts-ignore
    this.columns = this.formatColumns
  }

  @Watch('currentAreaId')
  @Watch('currentPublishId', { immediate: true })
  public handlerCurrentAreaIdChange() {
    // 公示页面进入
    if (this.currentPublishId) {
      this.commonParams.pub_id = this.currentPublishId
    } else {
      if (!this.currentAreaId) return
      this.commonParams.s_a_id = this.currentAreaId
    }
    this.getData()
  }

  public customRowSelectionOptions = {
    getCheckboxProps: (record: any) => {
      return {
        props: {
          disabled: !record.iid, // || !record.big_mb_ck, // Column configuration not to be checked
          name: record.name,
        },
      }
    },
    onSelect: (record: any, selected: boolean, selectedRows: any[], e: InputEvent) => {
      if (selected) {
        // @ts-ignore
        // if (typeof e.target?.checked !== 'undefined') {
        //   // @ts-ignore
        //   e.target.checked = false
        // }
        // debugger
        // const index = selectedRows.findIndex(
        //   (item) => record.big_mb_id === item.big_mb_id
        // )
        // if (record.big_mb_ck === null) {
        //   this.$message.error(
        //     '当前大户补贴面积未经过区县核定，暂不能参与补贴！！'
        //   )
        //   index !== -1 && selectedRows.splice(index, 1)
        //   return
        // }
        // console.log(index, selectedRows)
        // if (+record.big_mb_ck < 50) {
        //   this.$message.error('当前大户补贴面积未超过50亩，暂不能参与补贴！！')
        //   index !== -1 && selectedRows.splice(index, 1)
        //   return
        // }
      }
    },
    selections: false,
  }

  public customRow = (record: any) => {
    return {
      class: {
        'row-disabled': +record.big_mb_ck < 50,
      },
    }
  }

  public mounted() {
    this.handlerAddGrainColumn()
    this.handlerAddMaterialColumn()
    this.handlerAddMachineColumn()
    // this.columns.push(...)

    this.getBankTypes()
  }

  public handlerAddGrainColumn() {
    const grains = [
      '水稻',
      '玉米',
      '小麦',
      '红苕',
      '马铃薯',
      '大豆',
      '绿豆',
      '豌葫豆',
      '高粱',
      '荞麦',
      '肾豆',
      '红小豆',
    ]
    const grainsColumns = grains.map((item, index) => {
      const key = 'plant' + (index + 1)
      return {
        title: item,
        dataIndex: key,
        key,
        form: {
          type: 'a-input',
          placeholder: `请输入${item}面积`,
          renderMode: ['plant'],
          isExport: true,
          isShowList: false,
        },
      }
    })
    const index = this.fieldColumns.findIndex(item => item.key === 'plant')
    if (index !== -1) {
      // @ts-ignore
      this.fieldColumns = [...this.fieldColumns.slice(0, index+1), ...grainsColumns, ...this.fieldColumns.slice(index+1)]
    }
    this.handlerChangeRenderFields()
  }

  public handlerAddMaterialColumn() {
    const grains = [
      '购买种子花费(元)',
      '购买肥料花费(元)',
      '购买农膜花费(元)',
      '购买农药花费(元)',
    ]
    const grainsColumns = grains.map((item, index) => {
      const key = 'material' + (index + 1)
      return {
        title: item,
        dataIndex: key,
        key,
        form: {
          type: 'a-input',
          placeholder: `请输入${item}花费`,
          renderMode: ['material'],
          isShowList: false,
        },
      }
    })
    this.columns = this.columns.concat(grainsColumns)
  }

  public handlerAddMachineColumn() {
    const grains = ['微耕机(台)', '插秧机(台)', '收割机(台)', '灌溉设备(台)']
    const grainsColumns = grains.map((item, index) => {
      const key = 'machine' + (index + 1)
      return {
        title: item,
        dataIndex: key,
        key,
        form: {
          type: 'a-input',
          placeholder: `请输入${item}台数`,
          renderMode: ['machine'],
          isShowList: false,
        },
      }
    })
    this.columns = this.columns.concat(grainsColumns)
  }

  // public async getData() {
  //   // @fix 修复直接刷新页面时没有s_a_id 接口异常问题
  //   if (!this.currentPublishId && !this.commonParams.s_a_id) return
  //   const res = await this.getTableList()
  // }

  public getBankTypes() {
    commonServices.getBankType().then((res) => {
      const dict = []
      this.changeDict(
        'big_mb_bank_code',
        Object.keys(res.data).map((key) => res.data[key]),
        'dataSource'
      )
    })
  }

  public handlerTableAdd() {
    this.customMode = 'add'
    this.tableAdd()
    this.$nextTick(() => {
      this.currentRow = Object.assign(
        {},
        {
          big_mb_type: '1',
        }
      )
    })
    this.visibleTitle = '添加大户基本信息'
  }

  // 编辑前数据预处理
  public async handleTableEdit(row: ILargeMemberDetail, mode: string) {
    this.customMode = mode
    let methods
    switch (mode) {
      // 种粮
      case 'plant':
        // @ts-ignore
        this.tableApi.edit = largeMemberServices.updateLargeMemberPlant
        methods = this.currentPublishId
          ? publishServices.getPublishLargePlants
          : largeMemberServices.getLargeMemberPlants
        methods({
          big_mb_id: row.big_mb_id,
          s_a_id: row.s_a_id,
          // @ts-ignore
          pub_id: this.currentPublishId,
        }).then((res) => {
          this.tableEdit(Object.assign({}, row, res.data || {}))
          if (!res.data) {
            this.$nextTick(() => {
              this.$refs['custom-form'].resetFields()
            })
          }
          this.visibleTitle = '填写粮食种植面积(亩)'
          this.formItemLayout = {
            labelCol: { span: 4 },
            wrapperCol: { span: 20 },
          }
        })
        break
      // 农资
      case 'material':
        // @ts-ignore
        this.tableApi.edit = largeMemberServices.updateLargeMemberMaterial
        methods = this.currentPublishId
          ? publishServices.getPublishLargeMemberMaterial
          : largeMemberServices.getLargeMemberMaterial
        methods({
          big_mb_id: row.big_mb_id,
          s_a_id: row.s_a_id,
          pub_id: this.currentPublishId,
        }).then((res) => {
          this.tableEdit(Object.assign({}, row, res.data))
          if (!res.data) {
            this.$nextTick(() => {
              this.$refs['custom-form'].resetFields()
            })
          }
          this.visibleTitle = '填写购买农资花费'
        })
        break
      // 农机
      case 'machine':
        // @ts-ignore
        this.tableApi.edit = largeMemberServices.updateLargeMemberMachines
        methods = this.currentPublishId
          ? publishServices.getPublishLargeMemberMachines
          : largeMemberServices.getLargeMemberMachines
        methods({
          big_mb_id: row.big_mb_id,
          s_a_id: row.s_a_id,
          pub_id: this.currentPublishId,
        }).then((res) => {
          this.tableEdit(Object.assign({}, row, res.data))
          if (!res.data) {
            this.$nextTick(() => {
              this.$refs['custom-form'].resetFields()
            })
          }
          this.visibleTitle = '填写农机数量'
        })
        break
      // 审核
      case 'review':
        // @ts-ignore
        this.tableApi.edit = largeMemberServices.checkLargeMember
        let defaultParams: Partial<ILargeMemberDetail> = {}
        if (!row.big_mb_ck3) {
          defaultParams.big_mb_ck3 = '1'
        }
        if (!row.big_mb_ck2) {
          defaultParams.big_mb_ck2 = '1'
        }
        this.tableEdit({ ...row, ...defaultParams })
        this.visibleTitle = '补贴审核意见'
        this.formItemLayout = {
          labelCol: { span: 9 },
          wrapperCol: { span: 15 },
        }
        break
      default:
        this.tableApi.edit = largeMemberServices.updateLargeMember
        this.tableEdit({ ...row })
        this.visibleTitle = '编辑大户基础信息'
        this.formItemLayout = {
          labelCol: { span: 6 },
          wrapperCol: { span: 18 },
        }
    }
  }

  public drawerVisible = false
  public currentFieldType = 1
  // 管理耕地信息
  public handlerManageFarmLand(row: ILargeMemberDetail, mode: number) {
    this.currentRow = Object.assign({}, row)
    this.currentFieldType = mode
    this.drawerVisible = true
  }

  // 预览补贴申请表
  public subsidyVisible = false
  public handlerPreview(row: Partial<ILargeMemberDetail>) {
    this.currentRow = Object.assign({}, row)
    this.subsidyVisible = true
  }

  // 上传图片
  public handlerUploadImages(row: ILargeMember) {
    this.$dialog(
      UploadImage,
      {
        currentLargeMemberId: row.big_mb_id,
      },
      {
        title: '大户补贴申报表照片管理',
      }
    )
  }

  // 删除申报数据
  public handlerDeleteApply() {
    largeMemberServices
      .deleteLargeMember({
        big_mb_id: this.currentRow.big_mb_id,
        s_a_id: this.currentAreaId,
        all: '0',
      })
      .then((_) => {
        this.subsidyVisible = false
        this.$message.success('申报数据删除成功')
        this.getData()
      })
  }

  // 下载
  public handlerDownload(link: string) {
    const a = document.createElement('a')
    a.href = link
    a.target = '_blank'
    a.click()
  }

  // 核查
  public handlerCheck(row: ILargeMemberDetail) {
    const temp =
      this.currentRow.pay_unit === PayUnitTypeEnum.FIELD
        ? this.currentRow.field
        : this.currentRow.plant
    if (!this.currentRow.big_mb_ck1) {
      this.currentRow.big_mb_ck1 = temp
    }
    // 不相等
    if (this.currentRow.big_mb_ck1 !== temp) {
      this.$confirm({
        title: '提示',
        content: '核算面积和当前输入面积不相等，确认覆盖吗？',
        onOk: () => {
          this.currentRow.big_mb_ck1 = temp
        },
      })
    }
  }

  public handlerTableExpand() {
    // this.$nextTick(() => {
    //   let element = document.querySelectorAll('.large-grain-detail .ant-table-expanded-row');
    //   let len = element.length / 2;
    //   for (let i =0; i < len; i++) {
    //     // @ts-ignore
    //     element[i+len].style.height = element[i].offsetHeight + 'px';
    //     console.log(1)
    //   }
    // })
  }

  // 导出分户信息
  public handlerExportField(row: ILargeMemberDetail) {
    const loading = this.$message.loading({
      content: '数据导出中',
    })
    largeMemberServices
      .exportFieldExecl({
        big_mb_id: row.big_mb_id,
      })
      .then((_) => {
        const data = _.data
        // @ts-ignore
        const filename = _.headers['content-disposition']
          .replace(/(.*)(?=filename=)/g, '')
          .replace('filename=', '')
        console.log(_)
        const url = window.URL.createObjectURL(data)
        const link = document.createElement('a')
        link.style.display = 'none'
        link.href = url
        link.setAttribute('download', decodeURI(filename))
        document.body.appendChild(link)
        link.click()
        document.body.removeChild(link)
      })
      .finally(() => {
        loading()
      })
  }

  // 批量删除未补贴的大户
  public batchDelLoading = false
  public handlerBatchDelLarge() {
    this.batchDelLoading = true
    largeMemberServices
      .batchDelsUnUsed({
        s_a_id: this.currentAreaId,
      })
      .then((_) => {
        this.getData()
        this.$message.success('删除成功')
      })
      .finally(() => {
        this.batchDelLoading = false
      })
  }
}
</script>

<style scoped lang="less">
.action-button {
  margin: 0px 10px 0px 10px;
}
.form-item-class {
  margin-bottom: 0px;
}
.img-box {
  width: 100px;
  height: 100px;
  margin: 10px;
}
.item-blue {
  color: #1989fa;
}

/deep/ .ant-table-thead > tr > th,
.ant-table-tbody > tr > td {
  padding: 16px 16px;
  word-break: break-word;
  -ms-word-break: break-all;
}

// 审核表专用样式
/deep/ .review-form {
  padding-top: 20px;
  // .ant-form-item {
  //   &:nth-child(0), &:nth-child(3), &:nth-child(6), &:nth-child(9) {
  //     &::after {
  //       clear: both;
  //       display: table;
  //       content: '';
  //       width: 100%;
  //       height: 1px;
  //       border-bottom: 1px dashed #999;
  //       padding: 10px 0;
  //     }
  //   }

  //   &:nth-child(1), &:nth-child(4), &:nth-child(7), &:nth-child(10) {
  //     position: relative;
  //     &::before {
  //       position: absolute;
  //       top: -32px;
  //       left: 0;
  //       height: 30px;
  //       line-height: 30px;
  //       padding-right: 20px;
  //       font-size: 14px;
  //       font-weight: bold;
  //       background-color: #fff;
  //     }
  //   }

  //   &:nth-child(1) {
  //     &::before {
  //       content: '区县核定意见'
  //     }
  //   }

  //   &:nth-child(4) {
  //     &::before {
  //       content: '乡镇核查意见'
  //     }
  //   }
  //   &:nth-child(7) {
  //     &::before {
  //       content: '驻村负责人审核意见'
  //     }
  //   }

  //   &:nth-child(10) {
  //     &::before {
  //       content: '村委负责人审核意见'
  //     }
  //   }
  // }
}

/deep/ th[key='selection-column'] {
  position: relative;
  padding-top: 24px !important;
  padding-bottom: 0 !important;
  &::after {
    content: '补贴';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 100%;
    transform: translateX(-50%);
  }
}

/deep/ .large-grain-detail .ant-table {
  thead tr {
    background: #fafafa;
  }

  tbody tr {
    background: #fff;
  }

  th[key='big_mb_nam'],
  tr:not(:nth-child(1)) td:nth-of-type(8) {
    position: sticky;
    left: 60px;
    top: 0;
    z-index: 99;
    background: inherit;
  }
}

/deep/ .ant-table {
  th[key='pay_size_total'],
  th[key='pay_price'] {
    text-align: center !important;
  }
}

.message-tips {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.opreate {
  margin-left: 6px;
  margin-right: 10px;
  display: inline-block;
}
/deep/ .row-disabled {
  background-color: rgba(255, 49, 49, 0.5);
  cursor: pointer;
}
.one-line {
  height: 44px;
  overflow: hidden;
}
/deep/ .search-form {
  .form_item_is_used,
  .form_item_is_pub,
  .form_item_member_filter {
    .ant-form-item-label {
      font-weight: bold;
    }
  }
}
</style>
